import java.io.*;
import java.util.Scanner;

/*
 ID: ning yusui
 LANG: JAVA
 TASK: money
 */

public class money {
    Scanner in;
    PrintWriter out;

    public money() throws IOException {
        in = new Scanner(new File(this.getClass().getName() + ".in"));
        out = new PrintWriter(new BufferedWriter(new FileWriter(this.getClass().getName() +
                ".out")));
    }

    private void work() {
        int numberCoin = in.nextInt();
        int amountMoney = in.nextInt();
        int[] coins = new int[numberCoin];
        for (int i = 0; i < coins.length; i++) {
            coins[i] = in.nextInt();
        }
        long[] wayCount = new long[amountMoney + 1];
        wayCount[0] = 1;
        for (int i = 0; i < coins.length; i++) {
            int limit = wayCount.length - coins[i];
            for (int j = 0; j < limit; j++) {
                wayCount[j + coins[i]] += wayCount[j];
            }
        }
        out.println(wayCount[amountMoney]);
        out.flush();
        out.close();
    }


    public static void main(String[] args) throws IOException {
        new money().work();
    }
}
